package com.jing.android.notes.ui.util;

import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 *
 * @author JingTuo
 */
public class ActivityLifecycle implements Application.ActivityLifecycleCallbacks {

    private static final String TAG = ActivityLifecycle.class.getSimpleName();

    private ActivityLifecycle() {

    }

    public static ActivityLifecycle getInstance() {
        return SingleHolder.INSTANCE;
    }


    private static class SingleHolder {
        private final static ActivityLifecycle INSTANCE = new ActivityLifecycle();
    }

    @Override
    public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
        Log.d(TAG, "onActivityCreated: " + activity.getClass().getName());
    }

    @Override
    public void onActivityStarted(@NonNull Activity activity) {

    }

    @Override
    public void onActivityResumed(@NonNull Activity activity) {

    }

    @Override
    public void onActivityPaused(@NonNull Activity activity) {

    }

    @Override
    public void onActivityStopped(@NonNull Activity activity) {

    }

    @Override
    public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {

    }

    @Override
    public void onActivityDestroyed(@NonNull Activity activity) {

    }
}
